<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="Copyright" content="Douco Design." />
<title>云游登录中心</title>
<link href="__PUBLIC__/User/css/login.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/Admin/js/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/js/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/js/global.js"></script>
<script type="text/javascript" src="__PUBLIC__/Admin/js/jquery.tab.js"></script>
<script type="text/javascript" src="__PUBLIC__/Layui/laydate/laydate.js"></script>
<script type="text/javascript" src="__PUBLIC__/Layui/layer/layer.js"></script>
<style type="text/css">
body{
	font-family: "微软雅黑";
	font-size: 14px;
	background: url(__PUBLIC__/User/image/56a46b7590f5672af5b8.jpg) fixed center center;
}

.u_user{
	width: 25px;
	height: 25px;
	background: url(__PUBLIC__/User/images/login_ico.png);
	background-position:  -125px 0;
	position: absolute;
	margin: 12px 13px;
}
.us_uer{
	width: 25px;
	height: 25px;
	background-image: url(__PUBLIC__/User/images/login_ico.png);
	background-position: -125px -34px;
	position: absolute;
	margin: 12px 13px;
}
.info{
	width: 100px;
	height: 25px;
	background-position: -130px -34px;
	position: absolute;
	margin: 12px 28px;
}
.info2{
	width: 100px;
	height: 25px;
	background-position: -130px -34px;
	position: absolute;
	margin: 12px 297px;
}
</style>

<script type="text/javascript">

		function checkcode(code) {
			if (code == "") {
				return ;
			}
			var sp1 = document.getElementById('info1');
			$.post("{:U('User/index/code_match')}","code="+code,function(res){
				if (res == '手机被注册') {
						sp1.innerHTML = "<font color='green'>手机用户登录</font>"; 
					 }else if(res == '邮箱被注册'){
					 	sp1.innerHTML = "<font color='green'>邮箱用户登录</font>"; 
					 }else if(res == '可以注册'){
					 	sp1.innerHTML = "<font color='red'>无此用户</font>"; 
					 }else {
						sp1.innerHTML = "<font color='red'>输入格式错误</font>"; 
					 }
			},"text");
		}

		function checkpassword(pwd) {
			if (pwd == "") {
				return ;
			}
			var sp2 = document.getElementById('info2');
			$.post("{:U('User/index/pwd_match')}","pwd="+pwd,function(res){
				if (res == '0') {
					sp2.innerHTML = "<font color='red'>密码不符合规定</font>"; 
				}else if(res == '1') {
					sp2.innerHTML = "<font color='red'></font>"; 
				}
			},"text");
		}
		function login() {
			var sp1 = document.getElementById('code');
			var sp2 = document.getElementById('pwd');
			$.post("{:U('User/index/login_do')}", {"code":sp1.value,"pwd":sp2.value},function(res){
				
				 if (res == 'false') { 
				 	
					 layer.alert("密码与用户名不匹配");
				 }else  {
					location.href="{:U('User/index/index')}";
				 }
			},"text");
		}		
</script>
</head>
<body>
<div class="logo_box">
	<h3>南京云游欢迎您</h3>
	<form action=""  method="post" id="form">
		<div class="input_outer">
			<span class="u_user"></span>
			<input id="code" name="logname" class="text" onFocus=" if(this.value=='邮箱/手机号码') this.value=''" onBlur="if(this.value=='') this.value='邮箱/手机号码'" value="邮箱/手机号码" style="color: #FFFFFF !important" type="text" onchange="checkcode(this.value)">
			<span id="info1" class="info"></span>
		</div>
		<div class="input_outer">
			<span class="us_uer"></span>
			<label class="l-login login_password" style="color: rgb(255, 255, 255);display: block;">输入密码 6~16位</label>
			<input id="pwd" name="password" class="text" style="color: #FFFFFF !important; position:absolute; z-index:100;" onFocus="$('.login_password').hide()" onBlur="if(this.value=='') $('.login_password').show()" value="" type="password" onchange="checkpassword(this.value)">
			<span id="info2" class="info2"></span>
		</div>
		<div class="mb2"><button class="act-but submit" style="color: #FFFFFF" onclick="login()">登录</button></div>
	</form>
	<div class="sas">
		还没有账号！&nbsp<a href="{:U('User/Index/register')}" style="color: red;">注册</a>
	</div>
</div>
</body>
</html>